home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.4 / hdrs / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-08  |  19.5 KB  |  629 lines

  1.  
  2. /* $Id: defs.h,v 5.27 1993/05/08 19:41:13 syd Exp $ */
  3.  
  4. /*******************************************************************************
  5.  *  The Elm Mail System  -  $Revision: 5.27 $   $State: Exp $
  6.  *
  7.  *             Copyright (c) 1988-1992 USENET Community Trust
  8.  *             Copyright (c) 1986,1987 Dave Taylor
  9.  *******************************************************************************
  10.  * Bug reports, patches, comments, suggestions should be sent to:
  11.  *
  12.  *    Syd Weinstein, Elm Coordinator
  13.  *    elm@DSI.COM            dsinc!elm
  14.  *
  15.  *******************************************************************************
  16.  * $Log: defs.h,v $
  17.  * Revision 5.27  1993/05/08  19:41:13  syd
  18.  * make it now depend on mallocvoid
  19.  *
  20.  * Revision 5.26  1993/04/16  04:16:24  syd
  21.  * For convex, #if-defed memcpy, memset and sleep.
  22.  * From: rzm@oso.chalmers.se (Rafal Maszkowski)
  23.  *
  24.  * Revision 5.25  1993/04/12  03:30:23  syd
  25.  * On AIX, __STDC__ is not defined but it does use unistd.h, etc.  In
  26.  * hdrs/def.h, ANS_C already gets defined if __STDC__ or _AIX.  But this
  27.  * variable then needs to be used in src/init.c and hdrs/filter.h in place
  28.  * of the current test for __STDC__.
  29.  * From:    rstory@elegant.com (Robert Story)
  30.  *
  31.  * Revision 5.24  1993/04/12  03:25:26  syd
  32.  * Use I_UNISTD instead of UNISTD_H
  33.  *
  34.  * Revision 5.23  1993/04/12  03:22:49  syd
  35.  * Add UNISTD_H to check for unistd.h include
  36.  * From: Syd
  37.  *
  38.  * Revision 5.22  1993/04/12  01:51:42  syd
  39.  * Added safe_malloc(), safe_realloc(), and safe_strdup().  They
  40.  * will be used in the new elmalias utility.
  41.  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  42.  *
  43.  * Revision 5.21  1993/02/09  15:31:10  syd
  44.  * Make the str declare symbol ANSI_C, our contrived symbol
  45.  * so IBM compiles work ok.
  46.  * From: Syd
  47.  *
  48.  * Revision 5.20  1993/02/07  15:12:50  syd
  49.  * fix declaration of fseek, it was of the wrong type (sb int, was long)
  50.  *
  51.  * Revision 5.19  1993/02/03  17:12:53  syd
  52.  * move more declarations to defs.h, including sleep
  53.  * From: Syd
  54.  *
  55.  * Revision 5.18  1993/02/03  16:56:24  syd
  56.  * add unistd.h for include of lseek/fseek on stdc compilers
  57.  * From: Syd via prompt from mfvargo@netcom.com (Michael Vargo)
  58.  *
  59.  * Revision 5.17  1993/02/03  16:18:17  syd
  60.  * add strtokq
  61.  * From: Syd
  62.  *
  63.  * Revision 5.16  1993/01/20  03:02:19  syd
  64.  * Move string declarations to defs.h
  65.  * From: Syd
  66.  *
  67.  * Revision 5.15  1993/01/20  02:56:38  syd
  68.  * hide index and rindex declarations inside __STDC__ so AIX doesnt see it
  69.  *
  70.  * Revision 5.14  1993/01/19  05:07:05  syd
  71.  * Trim erroreous extra log entry
  72.  * From: Syd
  73.  *
  74.  * Revision 5.13  1993/01/19  04:47:12  syd
  75.  * Significant changes to provide consistent Date and From_ header
  76.  * cracking.  Overhauled date utilities and moved into library.  Moved
  77.  * real_from() into library.  Modified frm, newmail, and readmsg utilities
  78.  * to use library version of real_from().  Moved get_word() from Elm
  79.  * source into library.  Added new library routines atonum() and strfcpy().
  80.  * Fixed trailing backslash bug in len_next().
  81.  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  82.  *
  83.  * Revision 5.12  1993/01/05  03:36:10  syd
  84.  * remove leading 0s from access() defs as it confuses some
  85.  * compilers (and I know it shouldnt)
  86.  * From: Syd
  87.  *
  88.  * Revision 5.11  1992/12/11  01:58:50  syd
  89.  * Allow for use from restricted shell by putting SHELL=/bin/sh in the
  90.  * environment of spawned mail transport program.
  91.  * From: chip@tct.com (Chip Salzenberg)
  92.  *
  93.  * Revision 5.10  1992/12/11  01:29:27  syd
  94.  * add include of sys/types.h for time_t usage
  95.  *
  96.  * Revision 5.9  1992/12/07  02:47:45  syd
  97.  * fix time variables that are not declared time_t
  98.  * From: Syd via prompting from Jim Brown
  99.  *
  100.  * Revision 5.8  1992/11/26  01:46:26  syd
  101.  * add Decode option to copy_message, convert copy_message to
  102.  * use bit or for options.
  103.  * From: Syd and bjoerns@stud.cs.uit.no (Bjoern Stabell)
  104.  *
  105.  * Revision 5.7  1992/11/22  01:22:29  syd
  106.  * This mod fixes overlapping prototypes for strchr and index on
  107.  * Convex.
  108.  * From: Jukka Ukkonen <ukkonen@csc.fi>
  109.  *
  110.  * Revision 5.6  1992/11/07  20:40:27  syd
  111.  * flag for no tite for curses calls
  112.  *
  113.  * Revision 5.5  1992/11/07  20:05:52  syd
  114.  * change to use header_cmp to allow for linear white space around the colon
  115.  * From: Syd
  116.  *
  117.  * Revision 5.4  1992/10/27  01:40:08  syd
  118.  * fix compilation error on posix_signals for non STDC
  119.  * From: tom@osf.org
  120.  *
  121.  * Revision 5.3  1992/10/25  02:01:58  syd
  122.  * Here are the patches to support POSIX sigaction().
  123.  * From: tom@osf.org
  124.  *
  125.  * Revision 5.2  1992/10/25  01:47:45  syd
  126.  * fixed a bug were elm didn't call metamail on messages with a characterset,
  127.  * which could be displayed by elm itself, but message is encoded with QP
  128.  * or BASE64
  129.  * From: Klaus Steinberger <Klaus.Steinberger@Physik.Uni-Muenchen.DE>
  130.  *
  131.  * Revision 5.1  1992/10/03  22:34:39  syd
  132.  * Initial checkin as of 2.4 Release at PL0
  133.  *
  134.  *
  135.  ******************************************************************************/
  136.  
  137. /**  define file for ELM mail system.  **/
  138.  
  139.  
  140. #include <sys/types.h>    /* for fundamental types */
  141. #include "../config.h"
  142. #include "sysdefs.h"    /* system/configurable defines */
  143.  
  144.  
  145. # define VERSION    "2.4"                /* Version number... */
  146. # define VERS_DATE    "October 1, 1992"        /* for elm -v option */
  147. # define WHAT_STRING    \
  148.     "@(#) Version 2.4, USENET supported version, released October 1, 1992"
  149.  
  150. #if defined(__STDC__) || defined(_AIX)
  151. # define ANSI_C 1
  152. #endif
  153.  
  154. #define KLICK        25
  155.  
  156. #define SLEN        256        /* long for ensuring no overwrites... */
  157. #define SHORT        10        /* super short strings!          */
  158. #define NLEN        48        /* name length for aliases            */
  159. #define WLEN        20
  160. #define STRING        128    /* reasonable string length for most..      */
  161. #define LONG_STRING    512    /* even longer string for group expansion   */
  162. #define VERY_LONG_STRING 2560    /* huge string for group alias expansion    */
  163. #define MAX_LINE_LEN    5120    /* even bigger string for "filter" prog..   */
  164.  
  165. #define BREAK        '\0'          /* default interrupt    */
  166. #define BACKSPACE    '\b'         /* backspace character  */
  167. #define TAB        '\t'            /* tab character        */
  168. #define RETURN        '\r'         /* carriage return char */
  169. #define LINE_FEED    '\n'         /* line feed character  */
  170. #define FORMFEED    '\f'         /* form feed (^L) char  */
  171. #define COMMA        ','        /* comma character      */
  172. #define SPACE        ' '        /* space character      */
  173. #define DOT        '.'        /* period/dot character */
  174. #define BANG        '!'        /* exclaimation mark!   */
  175. #define AT_SIGN        '@'        /* at-sign character    */
  176. #define PERCENT        '%'        /* percent sign char.   */
  177. #define COLON        ':'        /* the colon ..        */
  178. #define BACKQUOTE    '`'        /* backquote character  */
  179. #define TILDE_ESCAPE    '~'        /* escape character~    */
  180. #define ESCAPE        '\033'        /* the escape        */
  181.  
  182. #define NO_OP_COMMAND    '\0'        /* no-op for timeouts   */
  183.  
  184. #define STANDARD_INPUT  0        /* file number of stdin */
  185.  
  186. #ifndef TRUE
  187. #define TRUE        1
  188. #define FALSE        0
  189. #endif
  190.  
  191. #define NO        0
  192. #define YES        1
  193. #define    NO_TITE        2        /* ti/te or in flag        */
  194. #define MAYBE        2        /* a definite define, eh?  */
  195. #define FORM        3        /*      <nevermind>        */
  196. #define PREFORMATTED    4        /* forwarded form...       */
  197.  
  198. #define SAME_PAGE    1        /* redraw current only     */
  199. #define NEW_PAGE    2        /* redraw message list     */
  200. #define ILLEGAL_PAGE    0        /* error in page list, punt */
  201.  
  202. #define PAD        0        /* for printing name of    */
  203. #define FULL        1        /*   the sort we're using  */
  204.  
  205. #define OUTGOING    0        /* defines for lock file   */
  206. #define INCOMING    1        /* creation..see lock()    */
  207.  
  208. /* options to the system_call() procedure */
  209. #define SY_USER_SHELL    (1<<0)        /* use user shell instead of /bin/sh */
  210. #define SY_ENV_SHELL    (1<<1)        /* put SHELL=[shell] into environ    */
  211. #define SY_ENAB_SIGHUP    (1<<2)        /* pgm to exec can handle signals    */
  212. #define SY_ENAB_SIGINT    (1<<3)        /*  ...and it can handle SIGINT too  */
  213. #define SY_DUMPSTATE    (1<<4)        /* create folder state dump file     */
  214.  
  215. /* options to the copy_message() procedure */
  216. #define CM_REMOVE_HEADER    (1<<0)    /* skip header of message */
  217. #define CM_REMOTE        (1<<1)    /* append remote from hostname to first line */
  218. #define CM_UPDATE_STATUS    (1<<2)    /* Update Status: Header  */
  219. #define CM_MMDF_HEAD        (1<<3)    /* strip mmdf message seperator */
  220. #define CM_REMAIL        (1<<4)    /* Add Sender: and Orig-To: headers */
  221. #define CM_DECODE        (1<<5)    /* prompt for key if message is encrypted */
  222.  
  223. #define EXECUTE_ACCESS    1        /* These five are        */
  224. #define WRITE_ACCESS    2        /*    for the calls       */
  225. #define READ_ACCESS    4        /*       to access()       */
  226. #define ACCESS_EXISTS    0        /*           <etc>         */
  227. #define EDIT_ACCESS    6        /*  (this is r+w access)   */
  228.  
  229. #define BIG_NUM        999999        /* big number!             */
  230. #define BIGGER_NUM    9999999     /* bigger number!          */
  231.  
  232. #define START_ENCODE    "[encode]"
  233. #define END_ENCODE    "[clear]"
  234.  
  235. #define DONT_SAVE    "[no save]"
  236. #define DONT_SAVE2    "[nosave]"
  237.  
  238. #define alias_file    ".aliases"
  239. #define group_file    ".groups"
  240. #define system_file    ".systems"
  241.  
  242. #define default_folders        "Mail"
  243. #define default_recvdmail    "=received"
  244. #define default_sentmail    "=sent"
  245.  
  246. /* environment variable with name of folder state dump file */
  247. #define FOLDER_STATE_ENV    "ELMSTATE"
  248.  
  249. /** some defines for the 'userlevel' variable... **/
  250.  
  251. #define RANK_AMATEUR    0
  252. #define AMATEUR        1
  253. #define OKAY_AT_IT    2
  254. #define GOOD_AT_IT    3
  255. #define EXPERT        4
  256. #define SUPER_AT_IT    5
  257.  
  258. /** some defines for the "status" field of the header and alias record **/
  259.  
  260. #define ACTION        1        /* bit masks, of course */
  261. #define CONFIDENTIAL    2
  262. #define DELETED        4
  263. #define EXPIRED        8
  264. #define FORM_LETTER    16
  265. #define NEW        32
  266. #define PRIVATE        64
  267. #define TAGGED        128
  268. #define URGENT        256
  269. #define VISIBLE        512
  270. #define UNREAD        1024
  271. #define STATUS_CHANGED    2048
  272. #define MIME_MESSAGE    4096    /* indicates existence of MIME Header */
  273. #define MIME_NEEDDECOD    8192    /* indicates that we need to call mmdecode */
  274. #define    MIME_NOTPLAIN    16384    /* indicates that we have a content-type,
  275.                    for which we need metamail anyway. */
  276.  
  277. /** some defines for the "type" field of the alias record **/
  278.  
  279. #define SYSTEM        1        /* bit masks, of course */
  280. #define USER        2
  281. #define PERSON        4
  282. #define GROUP        8
  283. #define DUPLICATE    16        /* system aliases only */
  284.  
  285. /** some defines to aid in the limiting of alias displays **/
  286.  
  287. #define BY_NAME        64
  288. #define BY_ALIAS    128
  289.  
  290. #define UNDELETE    0        /* purely for ^U function... */
  291.  
  292. /** values for headers exit_disposition field */
  293. #define UNSET    0
  294. #define KEEP    1
  295. #define    STORE    2
  296. #define DELETE    3
  297.  
  298. /** some months... **/
  299.  
  300. #define JANUARY        0            /* months of the year */
  301. #define FEBRUARY    1
  302. #define MARCH        2
  303. #define APRIL        3
  304. #define MAY        4
  305. #define JUNE        5
  306. #define JULY        6
  307. #define AUGUST        7
  308. #define SEPTEMBER    8
  309. #define OCTOBER        9
  310. #define NOVEMBER    10
  311. #define DECEMBER    11
  312.  
  313. #define equal(s,w)    (strcmp(s,w) == 0)
  314. #define min(a,b)    a < b? a : b
  315. #define ctrl(c)            c - 'A' + 1    /* control character mapping */
  316. #define plural(n)    n == 1 ? "" : "s"
  317. #define lastch(s)    s[strlen(s)-1]
  318. #define ifmain(a,b)    (inalias ? b : a)
  319.  
  320. #ifdef MEMCPY
  321.  
  322. #  ifdef I_MEMORY
  323. #   include <memory.h>
  324. #  else /* I_MEMORY */
  325. #   ifndef ANSI_C   /* ANSI puts these in string.h */
  326. #if defined(__convexc__)
  327. extern void *memcpy(), *memset();
  328. #else
  329. extern char *memcpy(), *memset();
  330. #endif
  331. extern int memcmp();
  332. #   endif /* ANSI_C */
  333. #  endif /* I_MEMORY */
  334.  
  335. #define bcopy(s1,s2,l) memcpy(s2,s1,l)
  336. #define bcmp(s1,s2,l) memcmp(s1,s2,l)
  337. #define bzero(s,l) memset(s,0,l)
  338. #endif /* MEMCPY */
  339.  
  340. #ifdef MALLOCVOID
  341. typedef    void *    malloc_t;
  342. #else
  343. typedef    char *    malloc_t;
  344. #endif
  345.  
  346. #ifdef I_STDLIB
  347. # include <stdlib.h>
  348. #else
  349. extern    malloc_t    calloc();
  350. extern    int        free();
  351. extern    malloc_t    malloc();
  352. extern    malloc_t    realloc();
  353. extern    void        exit();
  354. extern char        *getenv();
  355. #endif
  356.  
  357. /* find tab stops preceding or following a given column position 'a', where
  358.  * the column position starts counting from 1, NOT 0!
  359.  * The external integer "tabspacing" must be declared to use this. */
  360. #define prev_tab(a)    (((((a-1)/tabspacing))*tabspacing)+1)
  361. #define next_tab(a)    (((((a-1)/tabspacing)+1)*tabspacing)+1)
  362.  
  363. #define movement_command(c)    (c == 'j' || c == 'k' || c == ' ' ||           \
  364.                  c == BACKSPACE || c == ESCAPE || c == '*' || \
  365.                  c == '-' || c == '+' || c == '=' ||          \
  366.                  c == '#' || c == '@' || c == 'x' ||           \
  367.                  c == 'a' || c == 'q')
  368.  
  369. #define no_ret(s)    { register int xyz; /* varname is for lint */          \
  370.                   for (xyz=strlen(s)-1; xyz >= 0 &&               \
  371.                 (s[xyz] == '\r' || s[xyz] == '\n'); )          \
  372.                  s[xyz--] = '\0';                                 \
  373.             }
  374.               
  375. #define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
  376. #define first_word_nc(s,w) (strincmp(s,w, strlen(w)) == 0)
  377. #define ClearLine(n)    MoveCursor(n,0); CleartoEOLN()
  378. #define whitespace(c)    (c == ' ' || c == '\t')
  379. #define ok_rc_char(c)    (isalnum(c) || c == '-' || c == '_')
  380. #define ok_alias_char(c) (isalnum(c) || c == '-' || c == '_' || c == '.')
  381. #define onoff(n)    (n == 0 ? "OFF" : "ON")
  382.  
  383. /** The next function is so certain commands can be processed from the showmsg
  384.     routine without rewriting the main menu in between... **/
  385.  
  386. #define special(c)    (c == 'j' || c == 'k')
  387.  
  388. /** and a couple for dealing with status flags... **/
  389.  
  390. #define ison(n,mask)    (n & mask)
  391. #define isoff(n,mask)    (!ison(n, mask))
  392.  
  393. #define setit(n,mask)        n |= mask
  394. #define clearit(n, mask)    n &= ~mask
  395.  
  396. /** a few for the usage of function keys... **/
  397.  
  398. #define f_key1    1
  399. #define f_key2    2
  400. #define f_key3    3
  401. #define f_key4    4
  402. #define f_key5    5
  403. #define f_key6    6
  404. #define f_key7    7
  405. #define f_key8    8
  406.  
  407. #define MAIN    0
  408. #define ALIAS   1
  409. #define YESNO    2
  410. #define CHANGE  3
  411. #define READ    4
  412.  
  413. #define MAIN_HELP    0
  414. #define OPTIONS_HELP 1
  415. #define ALIAS_HELP   2
  416. #define PAGER_HELP   3
  417.  
  418. /** types of folders **/
  419. #define NO_NAME        0        /* variable contains no file name */
  420. #define NON_SPOOL    1        /* mailfile not in mailhome */
  421. #define SPOOL        2        /* mailfile in mailhome */
  422.  
  423. /* the following is true if the current mailfile is the user's spool file*/
  424. #define USERS_SPOOL    (strcmp(cur_folder, defaultfile) == 0)
  425.  
  426. /** some possible sort styles... **/
  427.  
  428. #define REVERSE        -        /* for reverse sorting           */
  429. #define SENT_DATE    1        /* the date message was sent     */
  430. #define RECEIVED_DATE    2        /* the date message was received */
  431. #define SENDER        3        /* the name/address of sender    */
  432. #define SIZE        4        /* the # of lines of the message */
  433. #define SUBJECT        5        /* the subject of the message    */
  434. #define STATUS        6        /* the status (deleted, etc)     */
  435. #define MAILBOX_ORDER    7        /* the order it is in the file   */
  436.  
  437. /** some possible sort styles...for aliases **/
  438.  
  439. #define ALIAS_SORT    1        /* the name of the alias         */
  440. #define NAME_SORT    2        /* the actual name for the alias */
  441. #define TEXT_SORT    3        /* the order of aliases.text     */
  442. #define LAST_ALIAS_SORT    TEXT_SORT
  443.  
  444. /* some stuff for our own malloc call - pmalloc */
  445.  
  446. #define PMALLOC_THRESHOLD    256    /* if greater, then just use malloc */
  447. #define PMALLOC_BUFFER_SIZE    2048    /* internal [memory] buffer size... */
  448.  
  449. /** the following macro is as suggested by Larry McVoy.  Thanks! **/
  450.  
  451. # ifdef DEBUG
  452. #  define   dprint(n,x)        {                 \
  453.                    if (debug >= n)  {        \
  454.                      fprintf x ;         \
  455.                      fflush(debugfile);         \
  456.                    }                \
  457.                 }
  458. # else
  459. #  define   dprint(n,x)
  460. # endif
  461.  
  462. /* some random structs... */
  463.  
  464. struct header_rec {
  465.     int  lines;        /** # of lines in the message    **/
  466.     int  status;        /** Urgent, Deleted, Expired?    **/
  467.     int  index_number;    /** relative loc in file...    **/
  468.     int  encrypted;        /** whether msg has encryption    **/
  469.     int  exit_disposition;    /** whether to keep, store, delete **/
  470.     int  status_chgd;    /** whether became read or old, etc. **/
  471.     long content_length;    /** content_length in bytes from message header    **/
  472.     long offset;        /** offset in bytes of message    **/
  473.     time_t received_time;    /** when elm received here    **/
  474.     char from[STRING];    /** who sent the message?    **/
  475.     char to[STRING];    /** who it was sent to        **/
  476.     char messageid[STRING];    /** the Message-ID: value    **/
  477.     char time_zone[12];    /**                incl. tz    **/
  478.     time_t time_sent;    /** gmt when sent for sorting    **/
  479.     char time_menu[SHORT];    /** just the month..day for menu **/
  480.     time_t tz_offset;    /** offset to gmt of time sent    **/
  481.     char subject[STRING];   /** The subject of the mail    **/
  482.     char mailx_status[WLEN];/** mailx status flags (RO...)    **/
  483.        };
  484.  
  485. struct alias_rec {
  486.     int   status;            /* DELETED, TAGGED, VISIBLE, ...     */
  487.     char  *alias;            /* alias name                        */
  488.     char  *last_name;        /* actual personal (last) name       */
  489.     char  *name;            /* actual personal name (first last) */
  490.     char  *comment;            /* comment, doesn't show in headers  */
  491.     char  *address;            /* non expanded address              */
  492.     int   type;            /* mask-- sys/user, person/group     */
  493.     long  length;            /* length of alias data on file      */
  494.        };
  495.  
  496. struct addr_rec {
  497.      char   address[NLEN];    /* machine!user you get mail as      */
  498.      struct addr_rec *next;    /* linked list pointer to next       */
  499.     };
  500.  
  501. /*
  502.  * Filled in by "load_folder_state_file()".  This allows an external program
  503.  * (e.g. "readmsg") to receive information on the current Elm state.
  504.  */
  505. struct folder_state {
  506.     char *folder_name;    /* full pathname to current folder    */
  507.     int num_mssgs;        /* number of messages in the folder    */
  508.     long *idx_list;        /* index of seek offsets for messages    */
  509.     int num_sel;        /* number of messages selected        */
  510.     int *sel_list;        /* list of selected message numbers    */
  511. };
  512.  
  513. #ifdef SHORTNAMES    /* map long names to shorter ones */
  514. # include <shortname.h>
  515. #endif
  516.  
  517. /** Let's make sure that we're not going to have any annoying problems with 
  518.     int pointer sizes versus char pointer sizes by guaranteeing that every-
  519.     thing vital is predefined... (Thanks go to Detlev Droege for this one)
  520. **/
  521.  
  522. #ifdef STRINGS
  523. #  include <strings.h>
  524. #else
  525. #  if defined(_CONVEX_SOURCE) && defined(index)
  526. #    undef _CONVEX_SOURCE
  527. #    include <string.h>     /* Now there is no proto for index. */
  528. #    define _CONVEX_SOURCE
  529. #  else
  530. #    include <string.h>
  531. #  endif
  532. #endif
  533. #ifndef ANSI_C   /* ANSI puts these in string.h */
  534. char *index(), *rindex(); /* names will be traslated by define in config.h */
  535. char *strtok(), *strcpy(), *strcat(), *strncpy(); /* more in string.h in ANSI */
  536. long lseek();
  537. int fseek();
  538. #if defined(__convexc__)
  539. unsigned sleep();
  540. #else
  541. unsigned long sleep();
  542. #endif
  543. #else
  544. #  ifdef I_UNISTD /* unistd.h available */
  545. #    include <unistd.h> /* ansi C puts sleep, lseek and fseek in unistd.h */
  546. #  else /* I_UNISTD */
  547. long lseek();
  548. int fseek();
  549. unsigned long sleep();
  550. #  endif /* I_UNISTD */
  551. #endif
  552. char *strtokq(); /* our own quote minding strtok */
  553.  
  554. #ifndef STRSTR
  555. char *strstr();
  556. #endif
  557.  
  558. #ifdef I_LOCALE
  559. #include <locale.h>
  560. #endif
  561.  
  562. #ifdef I_NL_TYPES
  563. #include <nl_types.h>
  564. #else
  565. #include "../hdrs/nl_types.h"
  566. #endif
  567.  
  568. #ifndef    USENLS
  569. #define MCprintf printf
  570. #define MCfprintf fprintf
  571. #define MCsprintf sprintf
  572. #endif
  573.  
  574. #ifdef POSIX_SIGNALS
  575. #define signal posix_signal
  576. #ifdef __STDC__
  577. extern SIGHAND_TYPE (*posix_signal(int, SIGHAND_TYPE (*)(int)))(int);
  578. #else    /* __STDC__ */
  579. extern SIGHAND_TYPE (*posix_signal())();
  580. #endif    /* __STDC__ */
  581. #else    /* POSIX_SIGNALS */
  582. #ifdef SIGSET
  583. #define signal sigset
  584. #ifdef _AIX
  585. extern SIGHAND_TYPE (*sigset(int sig, SIGHAND_TYPE (*func)(int)))(int);
  586. #endif
  587. #endif /* SIGSET */
  588. #endif /* POSIX_SIGNALS */
  589.  
  590. /*
  591.  * The "safe_malloc_fail_handler" vector points to a routine that is invoked
  592.  * if one of the safe_malloc() routines fails.  At startup, this will point
  593.  * to the default handler that prints a diagnostic message and aborts.  The
  594.  * vector may be changed to install a different error handler.
  595.  */
  596. extern void (*safe_malloc_fail_handler)();
  597.  
  598. char *argv_zero();
  599. char *bounce_off_remote();
  600. char *ctime();
  601. char *error_description();
  602. char *expand_system();
  603. char *format_long();
  604. char *get_alias_address();
  605. char *get_arpa_date();
  606. char *get_ctime_date();
  607. char *get_date();
  608. char *get_token();
  609. char *getlogin();
  610. char *level_name();
  611. char *shift_lower();
  612. char *strip_commas();
  613. char *strip_parens();
  614. char *strpbrk();
  615. char *qstrpbrk();
  616. char *strfcpy();
  617. char *strtok();
  618. char *tail_of_string();
  619. char *tgetstr();
  620. char *pmalloc();
  621. char *header_cmp();
  622. char *safe_strdup();
  623.  
  624. malloc_t safe_malloc();
  625. malloc_t safe_realloc();
  626.  
  627. long times();
  628. long ulimit();
  629.